package com.startup.yellocar.service.impl;
import java.util.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.startup.yellocar.dto.UserDTO;
import com.startup.yellocar.dao.UserDAO;

import com.startup.yellocar.service.UserService;

@Service
@Transactional
public class UserServiceImpl implements UserService {

	@Autowired
	protected UserDAO userDAO;

	@Transactional
	public void insert(UserDTO userDTO){
		userDAO.insert(userDTO);
	}

	@Transactional
	public void update(UserDTO userDTO){
		userDAO.update(userDTO);
	}

	@Transactional
	public UserDTO get(int id) {
		return userDAO.get(id);
	}

	@Transactional
	public List<UserDTO> getAll() {
		return userDAO.getAll();
	}

	@Transactional
	public void delete(UserDTO userDTO){
		userDAO.delete(userDTO);
	}

}
